package com.lu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lu.model.domain.ProcessApprovalLog;
import com.lu.model.entity.SysApprovalConfig;
import com.lu.model.entity.SysApprovalLog;
import com.lu.model.domain.ProcessApprovalWaitList;
import com.lu.model.request.ProcessApprovalQueryRequest;
import com.lu.model.request.ProcessApprovalUpdateInfoRequest;

import java.util.List;

/**
 * <p>
 * 系统审批日志 Mapper 接口
 * </p>
 *
 * @author currentCodeAuthor
 * @since 2022-08-01
 */
public interface SysApprovalLogMapper extends BaseMapper<SysApprovalLog> {

  /**
   * 待办列表
   * @param config
   * @param userId
   * @param roleIds
   * @return
   */
  List<ProcessApprovalWaitList> waitList(SysApprovalConfig config, Long userId, List<Long> roleIds);

  /**
   * 审批日志
   * @param request
   * @param config
   * @param userId
   * @param roleIds
   * @return
   */
  List<ProcessApprovalLog> processApprovalLogs(ProcessApprovalQueryRequest request, SysApprovalConfig config, Long userId, List<Long> roleIds);

  int submitCheck(SysApprovalConfig config, Long objId);

  int submit(SysApprovalConfig config, Long objId, Integer status);

  /**
   * 修改业务实体信息
   * @param request
   * @param config
   * @return
   */
  Integer updateBusinessObj(ProcessApprovalUpdateInfoRequest request, SysApprovalConfig config);

}
